package com.gitee.wsl.doc.prosemirror.ui.render

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.gitee.wsl.doc.prosemirror.model.fragment.Fragment

/**
 * Interface for rendering a specific block node type.
 * Implement this interface for each block node type you want to support.
 * @param T The type of the block node, must be a subclass of [Block].
 */
fun interface IBlockRenderer<T> where T : Fragment {

    /**
     * Composable function to render the given block node.
     * @param node The block node to render.
     * @param modifier Modifier to be applied to the rendered content.
     */
    @Composable
    fun OnViewRender(node: T, modifier: Modifier)
}